const USER_TOKEN = 'token';

let _code;
let _sessionKey; //转换过的sessionKey,不是最原始的那个
let _appId;


//-----------------

const setAppId = (appId) => {
    _appId = appId;
}

const getAppId = () => {
    return _appId;
}

//----------------------

const setSessionKey = (sessionKey) => {
    _sessionKey = sessionKey;
}

const getSessionKey = () => {
    return _sessionKey
}

//---------------

const setCode = (code) => {
    _code = code;
}

const getCode = () => {
    return _code;
}

//=----------

//----------
function setToken(token) {
    wx.setStorageSync(USER_TOKEN, token)
}


function getToken() {
    return wx.getStorageSync(USER_TOKEN);
}



//---------

export default{
    setToken,
    getToken,
    setCode,
    getCode,
    setSessionKey,
    getSessionKey,
    setAppId,
    getAppId,
}